﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Windows.Controls.Primitives;

using KELT;
using KELT.Viewport;

namespace KELT.Themes
{
    public partial class Generic : ResourceDictionary
    {
        ViewPortMgr viewPortMgr;
        CameraManager cameraMgr;

        public Generic()
        {
            viewPortMgr = (ViewPortMgr)Application.Current.FindResource("ViewportMgr");
            cameraMgr = (CameraManager)Application.Current.FindResource("CameraManager");
        }

        private void btn_play(object sender, RoutedEventArgs arg)
        {

            if (sender.GetType() == typeof(ToggleButton))
            {
                if((bool)(sender as ToggleButton).IsChecked)
                {
                    viewPortMgr.Sart();
                    cameraMgr.Start();
                }
                else
                {
                    viewPortMgr.Pause();
                    cameraMgr.Pause();
                }
            }
        }

        private void btn_moveToStart(object sender, RoutedEventArgs arg)
        {
            viewPortMgr.Stop();
            cameraMgr.Stop();
        }

        private void btn_moveToEnd(object sender, RoutedEventArgs arg)
        {
            viewPortMgr.Skip();
            cameraMgr.Skip();
        }
    }
}
